@extends('backstage.layout.master')
@section('title', '修改主题')
@section('style')
@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="backstage/types/list">主题列表</a>
            </li>
            <li>
                修改主题
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        修改主题
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form id="myform" class="form-horizontal" role="form" action="backstage/types/update" method="post" enctype="multipart/form-data">
                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                            <input type="hidden" name="type_id" value="{{$type->type_id}}">
                            <div class="form-group product_form {{$errors->first('type_name')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right"> 主题名称 </label>

                                <div class="col-sm-4">
                                    <input type="text" name="type_name" value="{{$type->type_name}}" id="type_name" placeholder="主题名称"
                                           class="width-100">
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline">{{$errors->first('type_name')}} </div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('type_image')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right">
                                    预览图 </label>
                                <div class="col-sm-4">
                                    <img src="{{$type->type_image}}" style="width: 200px;">
                                    <div class="space-4"></div>
                                    <div class="space-4"></div>
                                    <input type="file" id="type_image" name="type_image" placeholder="预览图">
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline">{{$errors->first('type_image')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('is_features')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right">类型</label>
                                <div class="col-sm-4">
                                    <select name="is_features">
                                        <option value="0" @if($type->is_features == 0) selected @endif>主题</option>
                                        <option value="1" @if($type->is_features == 1) selected @endif>功能按钮</option>
                                    </select>
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('is_features')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('app_id')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right">关联模块</label>
                                <div class="col-sm-4">
                                    <select name="app_id">
                                        <option value="3" selected>产品模块</option>
                                    </select>
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('app_id')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group  {{$errors->first('is_ahow')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right" for="form-field-1">
                                    是否显示</label>
                                <div class="col-sm-4">
                                    <input type="radio" @if($type->is_show == 0) checked @endif name="is_show" value="0" id="hide"> <label for="hide">否</label> <input type="radio" name="is_show" @if($type->is_show == 1) checked @endif value="1" id="show"> <label for="show">是</label>
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('is_ahow')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-5 col-md-7">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>

                                    &nbsp; &nbsp; &nbsp;
                                    <button class="btn" type="reset">
                                        <i class="icon-undo bigger-110"></i>
                                        重置
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div><!-- /.col -->
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script type="text/javascript">
        $(function () {
            $('#type_image').ace_file_input({
                no_file:'还未选择图片',
                btn_choose: '选择',
                btn_change: '重新选择',
                droppable: false,
                onchange: null,
                thumbnail: true
            });
        });
    </script>
@stop